import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';

/**
 * Generated class for the DetailsPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-details',
  templateUrl: 'details.html',
})
export class DetailsPage {
  item: any;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.item = this.navParams.data.item;
    // this.item =  {"acreage":"100","address":"山东济南","badges":[{"icon":"md-plus","id":"2","label":"电视机","type":"house_lable","value":"3"},{"icon":"md-plus","id":"1","label":"空调","type":"house_lable","value":"1"},{"icon":"md-plus","id":"3","label":"热水器","type":"house_lable","value":"2"}],"contact":{"id":"1","name":"贺作为","phone":"17863860445"},"createTime":1520943856000,"distance":0,"id":"1","lat":"116.7519900000","lgt":"36.5535800000","lived":0,"location":"","name":"丁豪广场","price":300,"status":"ACTIVE","total":4,"updateTime":1520943866000};
    console.log(this.item)
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad DetailsPage');
  }

  joint(){
    this.navCtrl.push("JointPage");
  }







  //ionic中当页面进入初始化的时候触发的生命周期方法
  ionViewWillEnter() {
    let elements = document.querySelectorAll(".tabbar");
    if (elements != null) {
      Object.keys(elements).map((key) => {
        elements[key].style.display = 'none';
      });
    }

  }

  ionViewWillLeave() {
    let elements = document.querySelectorAll(".tabbar");
    if (elements != null) {
      Object.keys(elements).map((key) => {
        elements[key].style.display = 'flex';
      });
    }
  }


}
